package aybolit.core.objects.model;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import java.io.Serializable;
import java.util.Collection;

/**
 * Created by IntelliJ IDEA.
 * User: Vadim
 * Date: 13.03.13
 * Time: 16:57
 * To change this template use File | Settings | File Templates.
 */
@javax.persistence.Table(name = "patient_statuses", catalog = "aybolit")
@Entity
public class PatientStatuses implements Serializable {
    private int patientStatusId;

    @javax.persistence.Column(name = "patient_status_id")
    @Id
    public int getPatientStatusId() {
        return patientStatusId;
    }

    public void setPatientStatusId(int patientStatusId) {
        this.patientStatusId = patientStatusId;
    }

    private String name;

    @javax.persistence.Column(name = "name")
    @Basic
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    private String note;

    @javax.persistence.Column(name = "note")
    @Basic
    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    private int deleted;

    @javax.persistence.Column(name = "deleted")
    @Basic
    public int getDeleted() {
        return deleted;
    }

    public void setDeleted(int deleted) {
        this.deleted = deleted;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        PatientStatuses that = (PatientStatuses) o;

        if (deleted != that.deleted) return false;
        if (patientStatusId != that.patientStatusId) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (note != null ? !note.equals(that.note) : that.note != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = patientStatusId;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (note != null ? note.hashCode() : 0);
        result = 31 * result + deleted;
        return result;
    }

    private Collection<Patientes> patientesesByPatientStatusId;

    @OneToMany(mappedBy = "patientStatusesByPatientStatus")
    public Collection<Patientes> getPatientesesByPatientStatusId() {
        return patientesesByPatientStatusId;
    }

    public void setPatientesesByPatientStatusId(Collection<Patientes> patientesesByPatientStatusId) {
        this.patientesesByPatientStatusId = patientesesByPatientStatusId;
    }
}
